package com.tear.language.node;

import java.util.HashMap;
import java.util.Map;

import net.sf.json.JSONObject;

public abstract class BaseNode {

	
	public abstract boolean parse(Map<String, Object> currParams,Map<String, Object> globalParams,JSONObject obj) throws Exception;
	
	public void pre(Map<String, Object> currParams,Map<String, Object> globalParams,JSONObject obj) throws Exception {
		
	}
	
	public void after(Map<String, Object> currParams,Map<String, Object> globalParams,JSONObject obj) throws Exception {
		
	}
	
	protected Map<String, Object> getAllParams(Map<String, Object> currParams,
			Map<String, Object> globalParams) {
		Map<String,Object> allParams = new HashMap<String,Object>();
		allParams.putAll(globalParams);
		allParams.putAll(currParams);
		return allParams;
	}

}
